using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Drawing.Drawing2D;
using System.Drawing.Text;

namespace ScreenShooter
{
    public partial class PreviewForm : Form
    {
        private Image image = null;
        public PreviewForm()
        {
            InitializeComponent();
            
        }


        public Bitmap Image
        {
            set { this.image = value; }
        }

        private void PreviewForm_Resize(object sender, EventArgs e)
        {
            
        }

    
        private void panel1_Paint(object sender, PaintEventArgs e)
        {
            Graphics g = e.Graphics;
            Rectangle _newSize = new Rectangle(
                this.panel1.AutoScrollPosition.X,
                this.panel1.AutoScrollPosition.Y,
                (int)(image.Width),
                (int)(image.Height ));

            g.SmoothingMode = SmoothingMode.HighQuality;
            g.TextRenderingHint = TextRenderingHint.AntiAliasGridFit;
            g.InterpolationMode = InterpolationMode.HighQualityBicubic;
            g.PixelOffsetMode = PixelOffsetMode.HighQuality;
            g.DrawImage(image, _newSize);

        }

        
    }
    
}